package com.kede.ienum.zhi;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description: 状态:0=待确认,1=置换中,2=已完成,3=已拒绝
 ** @Date: create in 2023/6/1 17:34
 ***/
@Getter
@AllArgsConstructor
public enum ZhiOrderStatusEnum {

    WAIT(0,"待确认",3),
    ING(1,"置换中",2),
    FINISH(2,"已完成",1),
    REFUSE(3,"已拒绝",4);

    @EnumValue
    private Integer code;
    private String value;
    private Integer enumIndex;

    public static ZhiOrderStatusEnum parse(Integer code) {
        for (ZhiOrderStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

}
